import request from './request'

// 获取消息列表
export const getMessageList = (params) => {
  return request({
    url: '/messages',
    method: 'GET',
    params
  })
}

// 发送消息
export const sendMessage = (data) => {
  return request({
    url: '/messages',
    method: 'POST',
    data
  })
}

// 标记消息为已读
export const markMessageAsRead = (id) => {
  return request({
    url: `/messages/${id}/read`,
    method: 'PUT'
  })
}

// 删除消息
export const deleteMessage = (id) => {
  return request({
    url: `/messages/${id}`,
    method: 'DELETE'
  })
}
